/**
 *Copyright (c) 2024 watereyes
 * safetymanagement is licensed under Mulan PubL v2.
 * You can use this software according to the terms and conditions of the Mulan
 * PubL v2.
 * You may obtain a copy of Mulan PubL v2 at:
 *          http://license.coscl.org.cn/MulanPubL-2.0
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PubL v2 for more details.
 */
package com.koron.system.service.api;


import com.koron.common.bean.StaffBean;
import com.koron.common.domain.DataBean;
import com.koron.system.domain.Message;
import org.koron.ebs.mybatis.SessionFactory;
import org.swan.bean.MessageBean;

import java.util.Date;
import java.util.List;

public interface MessageService {
    /**
     * 保存消息
     * @param message
     * @return
     */
    MessageBean<Integer> save(Message message);

    /**
     * 批量新增消息
     * @param messageList
     * @return
     */
    Integer batchInsert(List<Message> messageList);

    /**
     * 批量修改消息
     * @param messageList
     * @return
     */
    Integer batchUpdate(List<Message> messageList);

    /**
     * 批量删除消息
     * @param idList
     * @return
     */
    Integer batchDelete(List<String> idList);

    /**
     * 根据主键获取消息详情
     * @param id
     * @return
     */
    Message queryOne(String id);

    /**
     * 根据条件获取消息列表
     * @param receiverCode
     * @param startTime
     * @param endTime
     * @param start
     * @param rows
     * @return
     */
    MessageBean<DataBean<Message>> queryByCondition(String receiverCode, Date startTime,Date endTime,Integer start,Integer rows,String keyword);


    /**
     * 更新是否读取状态
     * @param id
     * @return
     */
    MessageBean<Integer> updateIsRead(String id);

    MessageBean getAllState(SessionFactory factory, StaffBean user);
}
